home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / misc / cmenu-0.000 / cmenu-0 / cmenu0.4 / cmenu next >
Encoding:
Text File  |  1994-11-19  |  16.7 KB  |  644 lines

  1. #!/bin/bash
  2.  
  3. ###############################################################################
  4. #
  5. # This is Color Menu, a dialog based shell script to help amateur users use
  6. # the UNIX system.
  7. #
  8. ###############################################################################
  9. #
  10. # This first section is for defining variables if this is going to be installed
  11. # in a users home directory. If this is to be installed in a system directory
  12. # these should be set in the users environment.
  13. #
  14. # Uncomment these lines and put in the apppropriate statements to use this from
  15. # a home directory. i.e. $HOME/bin BTW, make sure that $HOME/bin is in your
  16. # path 8-)
  17. #
  18. # SHLACT1=                     # Change to the machine where you have a shell
  19. # SHLACT2=                     # account. SHLACT2 is for a 2nd account
  20. # DOSDRV1=               # Change this to any directory that you would
  21. # DOSDRV2=                     # like to have in the menu
  22. # FRIEND1=
  23. # FRIEND2=               # Someone you would like to finger
  24. #
  25. ###############################################################################    
  26.  
  27. version="Color Menu v0.4"
  28. netfun()
  29. {
  30. while [ 0 ]; do
  31.     dialog --title "Net Connection" \
  32.         --backtitle "`date`  $version  `pwd`" \
  33.     --menu "Start or Stop SLIP Connection" 11 70 4 \
  34.         "1" "Open Network Connection" \
  35.         "2" "Close Network Connection" \
  36.     "3" "Return to Network Menu" \
  37.         "4" "Return to Main Menu" 2> /tmp/tmpchoice
  38.         if [ $? = 1 -o $? = 255 ]; then
  39.                 rm -f /tmp/tmpmsg /tmp/tmpchoice
  40.                 exit
  41.         fi
  42.         openchoice="`cat /tmp/tmpchoice`"
  43.         rm -f /tmp/tmpchoice
  44.         if [ "$openchoice" = "1" ]; then
  45.         dip $HOME/bradley.dip    # Change this to reflect your setup
  46.         fi
  47.         if [ "$openchoice" = "2" ]; then
  48.         kill -9 `ps | awk ' /dip/ && !/awk/ {print $1}'` 
  49.     #^^^ Change this to refelct your setup^^^
  50.         fi
  51.     if [ "$openchoice" = "3" ]; then
  52.     basefun
  53.     fi
  54.         if [ "$openchoice" = "4" ]; then
  55.         main
  56.         fi
  57. done
  58. }
  59.  
  60. webfun()
  61. {
  62. while [ 0 ]; do
  63. dialog \
  64.     --backtitle "`date`  $version  `pwd`" \
  65.     --menu "Lynx, Gopher, and similar clients" 11 70 4 \
  66.         "1" "Lynx" \
  67.         "2" "Gopher" \
  68.     "3" "Return to Network Menu" \
  69.         "4" "Return to Main Menu" 2> /tmp/tmpchoice
  70.                 if [ $? = 1 -o $? = 255 ]; then
  71.                         rm -f /tmp/tmpchoice
  72.                         exit
  73.                 fi
  74.         wwwchoice="`cat /tmp/tmpchoice`"
  75.         rm -f /tmp/tmpchoice
  76.         if [ "$wwwchoice" = "1" ]; then
  77.         dialog \
  78.     --inputbox "Site?" 8 50 2> /tmp/tmpchoice
  79.         site="`cat /tmp/tmpchoice`"
  80.         rm -f /tmp/tmpchoice
  81.         lynx ftp://$site
  82.         fi
  83.         if [ "$wwwchoice" = "2" ]; then
  84.         dialog \
  85.     --inputbox "Site?" 8 50 2> /tmp/tmpchoice
  86.         site="`cat /tmp/tmpchoice`"
  87.         rm -f /tmp/tmpchoice
  88.         gopher $site
  89.         fi
  90.     if [ "$wwwchoice" = "3" ]; then
  91.         basefun
  92.         fi
  93.         if [ "$wwwchoice" = "4" ]; then
  94.         main
  95.         fi
  96. done
  97. }
  98.  
  99. localprog()
  100. {
  101. while [ 0 ]; do
  102. dialog --title "Program Menu" \
  103.         --backtitle "`date`  $version  `pwd`" \
  104.                 --menu  "Local Programs" 13 70 6 \
  105.                 "1" "File Manager" \
  106.                 "2" "Text Editor" \
  107.                 "3" "GIF Viewer" \
  108.                 "4" "SplitVT" \
  109.                 "5" "Process Killer" \
  110.                 "6" "Return to Local Menu" 2> /tmp/tmpchoice
  111.                         if [ $? = 1 -o $? = 255 ]; then
  112.                         rm -f /tmp/tmpchoice
  113.                         exit
  114.                         fi
  115.                 progchoice="`cat /tmp/tmpchoice`"
  116.                 rm -f /tmp/tmpchoice
  117.                 if [ "$progchoice" = "1" ]; then
  118.                 uit
  119.                 fi
  120.                 if [ "$progchoice" = "2" ]; then
  121.                 joe
  122.                 fi
  123.                 if [ "$progchoice" = "3" ]; then
  124.                 zgv
  125.                 fi
  126.                 if [ "$progchoice" = "4" ]; then
  127.                 splitvt -upper bash -lower bash
  128.                 fi
  129.                 if [ "$progchoice" = "5" ]; then
  130.                 uitps
  131.                 fi
  132.                 if [ "$progchoice" = "6" ]; then
  133.                 localfun
  134.                 fi
  135. done        
  136. }
  137.  
  138. localdir()
  139. {
  140. while [ 0 ]; do
  141. dialog --title "Directory Manipulation" \
  142.         --backtitle "`date`  $version  `pwd`" \
  143.                 --menu "Change and view Directories" 14 70 7 \
  144.                 "1" "View Current Directory" \
  145.                 "2" "View Directory Contents" \
  146.                 "3" "Change Directory to $DOSDRV1" \
  147.                 "4" "Change Directory to $DOSDRV2" \
  148.                 "5" "Check Diskspace Statistics" \
  149.                 "6" "Change Directory to $HOME" \
  150.                 "7" "Return to Local Menu" 2> /tmp/tmpchoice
  151.                 if [ $? = 1 -o $? = 255 ]; then
  152.                         rm -f /tmp/tmpchoice
  153.                         exit
  154.                         fi
  155.                 dirchoice="`cat /tmp/tmpchoice`"
  156.                 rm -f /tmp/tmpchoice
  157.                 if [ "$dirchoice" = "1" ]; then
  158.                 pwd > /tmp/tmpmsg
  159.                 dialog \
  160.         --backtitle "`date`  $version  `pwd`" \
  161.                 --title "Current Working Directory" \
  162.                 --textbox /tmp/tmpmsg 5 70
  163.                 rm -f /tmp/tmpmsg
  164.                 fi
  165.                 if [ "$dirchoice" = "2" ]; then
  166.                 ls -l >/tmp/tmpmsg
  167.                 dialog \
  168.         --backtitle "`date`  $version  `pwd`" \
  169.                 --title "Contents of Current Directory" \
  170.                 --textbox /tmp/tmpmsg 40 70
  171.                 rm -f /tmp/tmpmsg
  172.                 fi
  173.                 if [ "$dirchoice" = "3" ]; then
  174.                 cd $DOSDRV1
  175.                 fi
  176.                 if [ "$dirchoice" = "4" ]; then
  177.                 cd $DOSDRV2
  178.                 fi
  179.                 if [ "$dirchoice" = "5" ]; then
  180.                 df >/tmp/tmpmsg
  181.                 dialog \
  182.                 --title "Diskspace Statistics" \
  183.                 --textbox /tmp/tmpmsg 12 76
  184.                 rm -f /tmp/tmpmsg
  185.                 fi
  186.                 if [ "$dirchoice" = "6" ]; then
  187.                 cd
  188.                 fi
  189.         if [ "$dirchoice" = "7" ]; then
  190.         localfun
  191.         fi
  192. done
  193. }
  194.  
  195. sysmon()
  196. {
  197. while [ 0 ]; do
  198.     dialog \
  199.     --backtitle "`date`  $version  `pwd`" \
  200.     --title "System Monitors" \
  201.     --menu "Check System Statistics" 15 70 8 \
  202.     "1" "Free Memory" \
  203.     "2" "Who is Logged In" \
  204.     "3" "Netstats" \
  205.     "4" "Continuous Netstat Listing" \
  206.     "5" "Top" \
  207.     "6" "Diskspace Statistics" \
  208.     "7" "Return to Local Services Menu" \
  209.     "8" "Return to Main Menu" 2>/tmp/tmpchoice
  210.         if [ $? = 1 -o $? = 255 ]; then
  211.                         rm -f /tmp/tmpchoice
  212.                         exit
  213.                 fi
  214.     syschoice="`cat /tmp/tmpchoice`"
  215.     rm -f /tmp/tmpchoice
  216.     if [ "$syschoice" = "1" ]; then
  217.         free >/tmp/tmpmsg
  218.                 dialog \
  219.                 --title "Free Memory" \
  220.                 --textbox /tmp/tmpmsg 8 76
  221.                 rm -f /tmp/tmpmsg
  222.         fi
  223.     if [ "$syschoice" = "2" ]; then
  224.         w >/tmp/tmpmsg
  225.                 dialog \
  226.                 --title "Who is Logged In" \
  227.                 --textbox /tmp/tmpmsg 40 76
  228.                 rm -f /tmp/tmpmsg
  229.         fi
  230.     if [ "$syschoice" = "3" ]; then
  231.         netstat >/tmp/tmpmsg
  232.                 dialog \
  233.                 --title "Netstats" \
  234.                 --textbox /tmp/tmpmsg 35 76
  235.                 rm -f /tmp/tmpmsg
  236.         fi
  237.     if [ "$syschoice" = "4" ]; then
  238.         netstat -c
  239.     fi
  240.     if [ "$syschoice" = "5" ]; then
  241.         top
  242.     fi
  243.     if [ "$syschoice" = "6" ]; then
  244.         df >/tmp/tmpmsg
  245.                 dialog \
  246.                 --title "Diskspace Statistics" \
  247.                 --textbox /tmp/tmpmsg 12 76
  248.                 rm -f /tmp/tmpmsg
  249.         fi
  250.     if [ "$syschoice" = "7" ]; then
  251.         localfun
  252.     fi
  253.     if [ "$syschoice" = "8" ]; then
  254.     main
  255.     fi
  256. done
  257. }
  258.  
  259.  
  260.     
  261. localfun()
  262. {
  263. while [ 0 ]; do
  264.     dialog --title "Local Services" \
  265.     --backtitle "`date`  $version  `pwd`" \
  266.     --menu "Things not requiring a Connection" 12 70 5 \
  267.         "1" "Program Menu" \
  268.         "2" "Directory Manipulation" \
  269.     "3" "System Monitors" \
  270.         "4" "Search File Lists" \
  271.         "5" "Return to Main Menu" 2> /tmp/tmpchoice
  272.                 if [ $? = 1 -o $? = 255 ]; then
  273.                         rm -f /tmp/tmpchoice
  274.                         exit
  275.                 fi
  276.         locchoice="`cat /tmp/tmpchoice`"
  277.         rm -f /tmp/tmpchoice
  278.         if [ "$locchoice" = "1" ]; then
  279.         localprog
  280.     fi
  281.     if [ "$locchoice" = "2" ]; then
  282.         localdir
  283.         fi
  284.     if [ "$locchoice" = "3" ]; then
  285.     sysmon
  286.     fi
  287.         if [ "$locchoice" = "4" ]; then
  288.         dialog \
  289.     --backtitle "`date`  $version  `pwd`" \
  290.     --inputbox "String to search for?" 8 50 2> /tmp/tmpchoice
  291.         string="`cat /tmp/tmpchoice`"
  292.         rm -f /tmp/tmpchoice
  293.         grep $string /usr/local/lib/lists/* > grep.txt
  294.         dialog \
  295.     --title "File Search Results" \
  296.         --yesno "View Results?" 6 50
  297.             if [ $? = 0 ]; then
  298.             dialog \
  299.         --title "File Search Results" \
  300.             --textbox "grep.txt" 45 70
  301.             fi
  302.     fi
  303.     if [ "$locchoice" = "5" ]; then
  304.     main
  305.     fi
  306. done
  307. }
  308.  
  309. ftpfun()
  310. {
  311. ###############################################################################
  312. #
  313. # You may want to change these to your favorite sites and/or sites near you :)
  314. #
  315. ###############################################################################
  316. while [ 0 ]; do
  317. dialog --title "FTP" \
  318.     --backtitle "`date`  $version  `pwd`" \
  319.         --menu "Pick a Site" 17 70 10 \
  320.         "1" "ftp.cdrom.com" \
  321.         "2" "garbo.vaasa.fi" \
  322.         "3" "OAK.Oakland.edu" \
  323.         "4" "wuarchive.wustl.edu" \
  324.         "5" "aurora.intel.com" \
  325.         "6" "ftp.microsoft.com" \
  326.         "7" "crh0027.urh.uiuc.edu" \
  327.         "8" "FTP elsewhere" \
  328.         "9" "Go for Files" \
  329.         "10" "Return to Basic Services Menu" 2> /tmp/tmpchoice
  330.                 if [ $? = 1 -o $? = 255 ]; then
  331.                         rm -f /tmp/tmpchoice
  332.                         exit
  333.                 fi
  334.         ftpchoice="`cat /tmp/tmpchoice`"
  335.         rm -f /tmp/tmpchoice
  336.         if [ "$ftpchoice" = "1" ]; then
  337.         ftp ftp.cdrom.com
  338.         fi
  339.         if [ "$ftpchoice" = "2" ]; then
  340.         ftp garbo.vaasa.fi
  341.         fi
  342.         if [ "$ftpchoice" = "3" ]; then
  343.         ftp OAK.Oakland.edu
  344.         fi
  345.         if [ "$ftpchoice" = "4" ]; then
  346.         ftp wuarchive.wustl.edu
  347.         fi
  348.         if [ "$ftpchoice" = "5" ]; then
  349.         ftp aurora.intel.com
  350.         fi
  351.         if [ "$ftpchoice" = "6" ]; then
  352.         ftp ftp.microsoft.com
  353.         fi
  354.         if [ "$ftpchoice" = "7" ]; then
  355.         ftp crh0027.urh.uiuc.edu
  356.         fi
  357.         if [ "$ftpchoice" = "8" ]; then
  358.         dialog \
  359.         --inputbox "Site to FTP?" 8 50 2> /tmp/tmpchoice
  360.         site="`cat /tmp/tmpchoice`"
  361.         rm -f /tmp/tmpchoice
  362.         ftp "$site"
  363.         fi
  364.         if [ "$ftpchoice" = "9" ]; then
  365.         dialog \
  366.     --inputbox "Enter like this: \nftp.ftp.org:/pub/files/README" \
  367.          10 50 2> /tmp/tmpchoice
  368.         filesite="`cat /tmp/tmpchoice`"
  369.         rm -f /tmp/tmpchoice
  370.         ftp "$filesite"
  371.         fi
  372.         if [ "$ftpchoice" = "10" ]; then
  373.         basefun
  374.         fi
  375. done        
  376. }
  377.  
  378. mailfun()
  379. {
  380. while [ 0 ]; do
  381.     dialog \
  382.     --backtitle "`date`  $version  `pwd`" \
  383.     --title "Mail Menu" \
  384.     --menu "Choose your Mailer" 11 70 4 \
  385.     "1" "Pine" \
  386.     "2" "Elm" \
  387.     "3" "Return to Basic Services Menu" \
  388.     "4" "Return to Main Menu" 2>/tmp/tmpchoice
  389.     mailchoice="`cat /tmp/tmpchoice`"
  390.     rm -f /tmp/tmpchoice
  391.     if [ "$mailchoice" = "1" ]; then
  392.     pine
  393.     fi
  394.     if [ "$mailchoice" = "2" ]; then
  395.     elm
  396.     fi
  397.     if [ "$mailchoice" = "3" ]; then
  398.     basefun
  399.     fi
  400.     if [ "$mailchoice" = "4" ]; then
  401.     main
  402.     fi
  403. done
  404. }
  405.  
  406. telfun()
  407. {
  408. while [ 0 ]; do
  409.        dialog \
  410.         --backtitle "`date`  $version  `pwd`" \
  411.     --title "Telnet Menu" \
  412.         --menu "Start a Remote Login" 12 70 5 \
  413.         "1" "Telnet to $SHLACT1" \
  414.         "2" "Telnet to $SHLACT2" \
  415.     "3" "Telnet Elsewhere" \
  416.     "4" "Return to Network Menu" \
  417.     "5" "Return to Main Menu" 2>/tmp/tmpchoice
  418.     netchoice="`cat /tmp/tmpchoice`"
  419.         rm -f /tmp/tmpchoice
  420.         if [ $? = 1 -o $? = 255 ]; then
  421.              rm -f /tmp/tmpmsg /tmp/tmpchoice
  422.              exit
  423.              fi
  424.     if [ "$netchoice" = "1" ]; then
  425.         telnet $SHLACT1
  426.         fi
  427.         if [ "$netchoice" = "2" ]; then
  428.         telnet $SHLACT2
  429.         fi
  430.     if [ "$netchoice" = "3" ]; then
  431.         dialog \
  432.         --inputbox "Site to Telnet?" 8 50 2> /tmp/tmpchoice
  433.         site="`cat /tmp/tmpchoice`"
  434.         rm -f /tmp/tmpchoice
  435.         telnet "$site"
  436.         fi
  437.     if [ "$netchoice" = "4" ]; then
  438.         basefun
  439.         fi
  440.         if [ "$netchoice" = "5" ]; then
  441.         main
  442.     fi
  443. done
  444. }
  445.  
  446. basefun()
  447. {
  448. while [ 0 ]; do
  449.        dialog \
  450.     --backtitle "`date`  $version  `pwd`" \
  451.     --menu "Basic Network Services" 18 70 11 \
  452.         "1" "Telnet" \
  453.         "2" "Read NetNews" \
  454.         "3" "IRC Chat" \
  455.         "4" "Mail" \
  456.         "5" "Archie File Search" \
  457.         "6" "FTP" \
  458.         "7" "Finger" \
  459.         "8" "Name Server Lookup" \
  460.     "9" "World Wide Web" \
  461.     "10" "Open and Close Network Connection" \
  462.         "11" "Return to Main Menu" 2> /tmp/tmpchoice
  463.         netchoice="`cat /tmp/tmpchoice`"
  464.     rm -f /tmp/tmpchoice
  465.         if [ $? = 1 -o $? = 255 ]; then
  466.                         rm -f /tmp/tmpchoice
  467.                         exit
  468.                 fi
  469.         if [ "$netchoice" = "1" ]; then
  470.         telfun
  471.         fi
  472.     if [ "$netchoice" = "2" ]; then
  473.         tin -r
  474.         fi
  475.         if [ "$netchoice" = "3" ]; then
  476.         irc
  477.         fi
  478.         if [ "$netchoice" = "4" ]; then
  479.         mailfun
  480.         fi
  481.         if [ "$netchoice" = "5" ]; then
  482.         archiefun
  483.     fi
  484.         if [ "$netchoice" = "6" ]; then
  485.     ftpfun
  486.         fi
  487.         if [ "$netchoice" = "7" ]; then
  488.         netfinger
  489.     fi
  490.         if [ "$netchoice" = "8" ]; then
  491.         dialog \
  492.     --inputbox "Enter Name or IP number" 8 50 2> /tmp/tmpchoice 
  493.         site="`cat /tmp/tmpchoice`"
  494.         rm -f /tmp/tmpchoice
  495.         nslookup $site >/tmp/tmpmsg
  496.         dialog \
  497.     --title "nslookup Results for $site" \
  498.         --textbox /tmp/tmpmsg 10 40
  499.         rm -f /tmp/tmpmsg
  500.         fi
  501.     if [ "$netchoice" = "9" ]; then
  502.     webfun
  503.     fi
  504.     if [ "$netchoice" = "10" ]; then
  505.     netfun
  506.     fi
  507.         if [ "$netchoice" = "11" ]; then
  508.         main
  509.     fi
  510. done  
  511. }
  512.  
  513. archiefun()
  514. {
  515. while [ 0 ]; do
  516. dialog \
  517. --title "Archie" \
  518. --backtitle "`date`  $version  `pwd`" \
  519. --menu "Find a file with Archie" 11 70 4 \
  520. "1" "Archie Search" \
  521. "2" "Archie via Telnet" \
  522. "3" "Return to Basic Services Menu" \
  523. "4" "Return to Main Menu" 2> /tmp/tmpchoice
  524.      if [ $? = 1 -o $? = 255 ]; then
  525.          rm -f /tmp/tmpmsg /tmp/tmpchoice
  526.          exit
  527.      fi
  528. echo "`cat /tmp/tmpchoice`"
  529. archchoice="`cat /tmp/tmpchoice`"
  530. rm -f /tmp/tmpchoice
  531. if [ "$archchoice" = "1" ]; then
  532.     dialog --title "Archie Search" \
  533.         --inputbox "String to search for?" 8 50 2> /tmp/tmpchoice
  534.         string="`cat /tmp/tmpchoice`"
  535.         rm -f /tmp/tmpchoice
  536.         archie -s "$string" -o grep.txt
  537.         dialog --yesno "View Results?" 6 50
  538.         if [ $? = 0 ]; then
  539.         dialog \
  540.         --title "Archie Search Results" \
  541.         --textbox "grep.txt" 45 70
  542.         fi
  543. fi
  544. if [ "$archchoice" = "2" ]; then
  545.     telnet archie.unl.edu
  546. fi
  547. if [ "$archchoice" = "3" ]; then
  548.     basefun
  549. fi
  550. if [ "$archchoice" = "4" ]; then
  551.     main
  552. fi
  553. done
  554. }        
  555. netfinger()
  556. {
  557. while [ 0 ]; do
  558. dialog \
  559. --title "Finger" \
  560. --backtitle "`date`  $version  `pwd`" \
  561. --menu "Find out about someone" 14 70 7 \
  562. "1" "$FRIEND1" \
  563. "2" "$FRIEND2" \
  564. "3" "$SHLACT1" \
  565. "4" "$SHLACT2" \
  566. "5" "Finger Someone Else" \
  567. "6" "Return to Basic Services Menu" \
  568. "7" "Return to Main Menu" 2> /tmp/tmpchoice
  569. if [ $? = 1 -o $? = 255 ]; then
  570.          rm -f /tmp/tmpmsg /tmp/tmpchoice
  571.          exit
  572. fi
  573. fingerchoice="`cat /tmp/tmpchoice`"
  574. rm -f /tmp/tmpchoice
  575. if [ "$fingerchoice" = "1" ]; then 
  576.     finger $FRIEND1 > /tmp/tmpmsg
  577.     dialog \
  578.     --textbox /tmp/tmpmsg 45 79 
  579.         rm -f /tmp/tmpmsg
  580.         fi
  581. if [ "$fingerchoice" = "2" ]; then
  582.     finger $FRIEND2 > /tmp/tmpmsg
  583.     dialog \
  584.     --textbox /tmp/tmpmsg 45 79
  585.         rm -f /tmp/tmpmsg
  586.         fi
  587. if [ "$fingerchoice" = "3" ]; then
  588.     finger "@$SHLACT1" > /tmp/tmpmsg
  589.     dialog \
  590.     --textbox /tmp/tmpmsg 45 79
  591.         rm -f /tmp/tmpmsg
  592.         fi
  593. if [ "$fingerchoice" = "4" ]; then
  594.     finger "@$SHLACT2" > /tmp/tmpmsg
  595.     dialog \
  596.     --textbox /tmp/tmpmsg 45 79
  597.         rm -f /tmp/tmpmsg
  598.         fi
  599. if [ "$fingerchoice" = "5" ]; then
  600.     dialog \
  601.         --inputbox "Who?" 8 50 2> /tmp/tmpchoice
  602.         who="`cat /tmp/tmpchoice`"
  603.         rm -f /tmp/tmpchoice
  604.     finger "$who" > /tmp/tmpmsg
  605.     dialog \
  606.     --textbox /tmp/tmpmsg 45 79
  607.         rm -f /tmp/tmpmsg
  608.         fi
  609. if [ "$fingerchoice" = "6" ]; then
  610. basefun
  611. fi
  612. if [ "$fingerchoice" = "7" ]; then
  613. main
  614. fi
  615. done
  616. }
  617. main()
  618. while [ 0 ]; do
  619. dialog --title "Main Menu" \
  620. --backtitle "`date`  $version  `pwd`" \
  621. --menu "Welcome to Color Menu 0.4" 10 70 3 \
  622. "1" "Network Services" \
  623. "2" "Local Services" \
  624. "3" "Quit" 2> /tmp/tmpchoice
  625. if [ $? = 1 -o $? = 255 ]; then
  626.          rm -f /tmp/tmpmsg /tmp/tmpchoice
  627.          exit
  628. fi
  629. mainchoice="`cat /tmp/tmpchoice`"
  630. rm -f /tmp/tmpchoice /tmp/tmpmsg
  631. if [ "$mainchoice" = "1" ]; then
  632.     basefun
  633. fi
  634. if [ "$mainchoice" = "2" ]; then
  635.     localfun             
  636. fi
  637. if [ "$mainchoice" = "3" ]; then
  638.     exit
  639. fi
  640. done 
  641. }
  642. main
  643.